package com.maolong.fenkufenbiaotest.service;

import com.maolong.fenkufenbiaotest.mapper.EmployMapper;
import com.maolong.fenkufenbiaotest.mapper.UserMapper;
import com.maolong.fenkufenbiaotest.pojo.Employ;
import com.maolong.fenkufenbiaotest.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.time.LocalDateTime;
import java.util.Date;
import java.util.List;

@Service
public class EmployService {

    @Autowired
    EmployMapper employMapper;

    public List<Employ> getEmployList(){
        return employMapper.selectList(null);
    }

    public void insert(){
        Employ employ = new Employ();
        employ.setName("张三");
        employ.setAddTime(LocalDateTime.now());
        int monthValue = employ.getAddTime().getMonthValue();
        employ.setMonth(monthValue);
        System.out.println(monthValue);

        employMapper.insert(employ);
    }


}